class MathDojo
	attr_accessor :total
	
	def initialize()
		@total = 0
	end 

	def add(*num)
		num.flatten.each {|i| @total += i}
		return self 
	end

	def subtract(*num)
		num.flatten.each {|i| @total -= i}
		return self
	end

end

test = MathDojo.new.add(1).add([3,5,7,8],[2,4.3,1.25]).subtract([2,3],[1.1,2.3])
puts test.total
